<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">
    <ui:define name="content">
        <h:form id="formMain">
            <h1>Stakeholder Edit Branch Info</h1>

            <p:panel id="panel" header="Change Branch Info">
                <f:metadata>
                    <f:viewParam name ="autoConfirm" value ="#{stakeholderManagerBean.selectedBranch.fnBIOTR.autoConfirm}" />
                </f:metadata>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>
                <p:messages />
                <h:panelGrid columns="3" cellpadding="10" >
                    <h:outputLabel for="branchname" style="font-weight: bold" value="Branch name: " />
                    <h:inputText required="true" label="Branch Name" requiredMessage="Branch name is required." id="branchname" value="#{stakeholderManagerBean.selectedBranch.name}">
                    </h:inputText>
                    <p:message for="branchname" />

                    <h:outputLabel for="address" style="font-weight: bold" value="Address: " />
                    <h:inputText required="true" label="Address" requiredMessage="Address is required." id="address" value="#{stakeholderManagerBean.selectedBranch.branchAddress.houseNumber}">
                    </h:inputText>
                    <p:message for="address" />

                    <h:outputLabel for="phoneNumber" style="font-weight: bold" value="Phone Number: " />
                    <h:inputText required="true" label="Phone Number" requiredMessage="Phone Number is required." id="phoneNumber" value="#{stakeholderManagerBean.selectedBranch.contactNumber}">
                    </h:inputText>
                    <p:message for="phoneNumber" />

                    <p:commandButton value="AutoConfirm" disabled="#{stakeholderManagerBean.selectedBranch.fnBIOTR.autoConfirm}"  action="stakeholder/StakeholderEditBranchInfo?faces-redirect=true" ajax="true">
                        <f:param name="autoConfirm" value="true" />
                    </p:commandButton>

                    <p:commandButton value="ManualConfirm" disabled="#{!stakeholderManagerBean.selectedBranch.fnBIOTR.autoConfirm}" action="stakeholder/StakeholderEditBranchInfo?faces-redirect=true" ajax="true">
                        <f:param name="autoConfirm" value="false" />
                    </p:commandButton>

                    <h:outputLabel for="blank" style="font-weight: bold" value=""/>
                    <h:outputLabel for="percentConfirm" style="font-weight: bold" value="Percent Confirm: " />
                    <h:inputText disabled="#{stakeholderManagerBean.selectedBranch.fnBIOTR.autoConfirm}" required="#{stakeholderManagerBean.selectedBranch.fnBIOTR.autoConfirm}" label="PercentConfirm" requiredMessage="Phone Number is required." id="percentConfirm" value="#{stakeholderManagerBean.selectedBranch.fnBIOTR.percentManualConfirm}">
                    </h:inputText>

                    <h:outputLabel for="blank" style="font-weight: bold" value=""/>
                    <h:outputLabel for="depositPercentCharge" style="font-weight: bold" value="Deposit Percent Charge: " />
                    <h:inputText  required="true" label="DepositPercentCharge" requiredMessage="Deposit Percent Charge is required." id="depositPercentCharge" value="#{stakeholderManagerBean.selectedBranch.fnBIOTR.depositPercentCharge}">
                    </h:inputText>

                    <h:outputLabel for="blank" style="font-weight: bold" value=""/>
                    <h:outputLabel for="showPercentCharge" style="font-weight: bold" value="Show Percent Charge: " />
                    <h:outputText  id="showPercentCharge" value="#{stakeholderManagerBean.selectedBranch.fnBIOTR.showPercentCharge}"/>

                    <h:outputLabel for="blank" style="font-weight: bold" value=""/>
                    <h:outputLabel for="noShowPercentCharge" style="font-weight: bold" value="No Show Percent Charge: " />
                    <h:outputText  id="noShowPercentCharge" value="#{stakeholderManagerBean.selectedBranch.fnBIOTR.noShowPercentCharge}"/>

                    <h:outputLabel for="blank" style="font-weight: bold" value=""/>
                    <h:outputLabel for="eatingTime" style="font-weight: bold" value="Estimate Eating Time: " />
                    <h:selectOneMenu value="#{stakeholderManagerBean.selectedBranch.fnBIOTR.eatingTime}" id="eatingTimeList">
                        <f:selectItem itemLabel="30 minutes" itemValue="0.5"></f:selectItem>
                        <f:selectItem itemLabel="45 minutes" itemValue="0.75"></f:selectItem>
                        <f:selectItem itemLabel="1 hour" itemValue="1"></f:selectItem>
                        <f:selectItem itemLabel="1 hour 15 minutes" itemValue="1.25"></f:selectItem>
                        <f:selectItem itemLabel="1 hour 30 minutes" itemValue="1.50"></f:selectItem>
                        <f:selectItem itemLabel="1 hour 45 minutes" itemValue="1.75"></f:selectItem>
                        <f:selectItem itemLabel="2 hours" itemValue="2"></f:selectItem>
                        <f:selectItem itemLabel="2 hour 15 minutes" itemValue="2.25"></f:selectItem>
                        <f:selectItem itemLabel="2 hour 30 minutes" itemValue="2.50"></f:selectItem>
                        <f:selectItem itemLabel="2 hour 45 minutes" itemValue="2.75"></f:selectItem>
                        <f:selectItem itemLabel="3 hours" itemValue="3"></f:selectItem>
                        <f:selectItem itemLabel="3 hour 15 minutes" itemValue="3.25"></f:selectItem>
                        <f:selectItem itemLabel="3 hour 30 minutes" itemValue="3.50"></f:selectItem>
                        <f:selectItem itemLabel="3 hour 45 minutes" itemValue="3.75"></f:selectItem>
                        <f:selectItem itemLabel="4 hours" itemValue="4"></f:selectItem>
                        <f:selectItem itemLabel="4 hours 15 minutes" itemValue="4.25"></f:selectItem>
                        <f:selectItem itemLabel="4 hours 30 minutes" itemValue="4.50"></f:selectItem>
                        <f:selectItem itemLabel="4 hour 45 minutes" itemValue="4.75"></f:selectItem>
                        <f:selectItem itemLabel="5 hours" itemValue="5"></f:selectItem>
                        <f:selectItem itemLabel="5 hour 15 minutes" itemValue="5.25"></f:selectItem>
                        <f:selectItem itemLabel="5 hour 30 minutes" itemValue="5.50"></f:selectItem>
                        <f:selectItem itemLabel="5 hour 45 minutes" itemValue="5.75"></f:selectItem>
                        <f:selectItem itemLabel="6 hours" itemValue="6"></f:selectItem>   
                    </h:selectOneMenu>

                </h:panelGrid>
                <p:commandButton id="btn" value="Save Branch Info" update="panel" actionListener="#{stakeholderManagerBean.editBranchInfo}" ajax="true" />
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>
